import request from '@/utils/request'

// ~~~~~~~~~~~~~~~~~~~~~~~ { 教学点 } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 教学点 列表接口

export const teachingSchool = (data) => {
  return request({
    url: '/api/v1/pri/services/listTeachingPointReview',
    method: 'POST',
    data
  })
}

// 教学点审批接口
export const doPointReview = (data) => {
  return request({
    url: '/api/v1/pri/services/doPointReview',
    method: 'POST',
    data
  })
}

// 提交注销教学点申请
export const cancelTeachingPoint = (data) => {
  return request({
    url: '/api/v1/pri/services/cancelTeachingPoint',
    method: 'POST',
    data
  })
}

// 机构端 展示页 新增教学点信息
export const addServicesTeachingPoint = (data) => {
  return request({
    url: '/api/v1/pri/services/addServicesTeachingPoint',
    method: 'POST',
    data
  })
}

// 获取所属区县地址菜单
export const listArea = (data) => {
  return request({
    url: '/api/v1/pri/manager/listArea',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~~~~{ 教师 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 教师列表
export const listTeacherReview = (data) => {
  return request({
    url: '/api/v1/pri/teacher/listTeacherReview',
    method: 'POST',
    data
  })
}
// 注销教师申请
export const cancelTeacher = (data) => {
  return request({
    url: '/api/v1/pri/teacher/cancelTeacher',
    method: 'POST',
    data
  })
}
// 删除教师
export const delTeacher = (data) => {
  return request({
    url: '/api/v1/pri/teacher/delTeacher',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~~~~{ 机构管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 机构列表
export const listServices = (data) => {
  return request({
    url: '/api/v1/pri/services/listServices',
    method: 'POST',
    data
  })
}

// 机构详情
export const servicesDetails = (data) => {
  return request({
    url: '/api/v1/pri/services/getDetails',
    method: 'POST',
    data
  })
}

// 机构摄像头列表
export const servicesCamers = (data) => {
  return request({
    url: '/api/v1/pri/cameras/listCameras',
    method: 'POST',
    data
  })
}

// 修改机构电话号码
export const editServicesPhone = (data) => {
  return request({
    url: '/api/v1/pri/services/editPhone',
    method: 'POST',
    data
  })
}

// 批量通过
export const doTeacherReview = (data) => {
  return request({
    url: '/api/v1/pri/teacher/doTeacherReview',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~{ 教材管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 教材列表
export const listTeachingMaterial = (data) => {
  return request({
    url: '/api/v1/pri/material/listTeachingMaterial',
    method: 'POST',
    data
  })
}

// 教材审批
export const doTeachingMaterialReview = (data) => {
  return request({
    url: '/api/v1/pri/material/doTeachingMaterialReview',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~{ 合同管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 合同列表
export const listContract = (data) => {
  return request({
    url: '/api/v1/pri/contract/listContract',
    method: 'POST',
    data
  })
}
// ~~~~~~~~~~~~~~~~~~~~~~~~{ 财务人员管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 财务人员列表
export const listPer = (data) => {
  return request({
    url: '/api/v1/pri/personnel/listPer',
    method: 'POST',
    data
  })
}
// 新增财务人员
export const addPer = (data) => {
  return request({
    url: '/api/v1/pri/personnel/addPer',
    method: 'POST',
    data
  })
}
// 删除财务人员
export const delPer = (data) => {
  return request({
    url: '/api/v1/pri/personnel/delPer',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~~~~~{ 用户管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 获取城市列表
export const getRoleCity = (data) => {
  return request({
    url: '/api/v1/pri/manager/getRoleCity',
    method: 'POST',
    data
  })
}

// 获取城市用户
export const listUserByCityCode = (data) => {
  return request({
    url: '/api/v1/pri/user/listUserByCityCode',
    method: 'POST',
    data
  })
}

// 启用\禁用账户
export const disableAccount = (data) => {
  return request({
    url: '/api/v1/pri/user/disableAccount',
    method: 'POST',
    data
  })
}

// 新增用户
export const addManagerUser = (data) => {
  return request({
    url: '/api/v1/pri/user/addManagerUser',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~~~~{ 机构账户管理 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// 获取机构账户列表
export const getServicesUser = (data) => {
  return request({
    url: '/api/v1/pri/manager/getServicesUser',
    method: 'POST',
    data
  })
}

// 修改机构账户密码
export const editUser = (data) => {
  return request({
    url: '/api/v1/pri/manager/editUser',
    method: 'POST',
    data
  })
}

// ~~~~~~~~~~~~~~~~~~~~~~~{ 上传文件 }~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

export const upload = (data) => {
  return request({
    url: '/api/v1/pri/util/upload',
    method: 'POST',
    data
  })
}

// [
//   {
//     "id": 1,
//     "name": "机构性质"
//   },
//   {
//     "id": 3,
//     "name": "机构类型"
//   },
//   {
//     "id": 5,
//     "name": "举办者类型"
//   },
//   {
//     "id": 6,
//     "name": "学科类别"
//   },
//   {
//     "id": 7,
//     "name": "教师资格种类"
//   },
//   {
//     "id": 8,
//     "name": "年级"
//   },
//   {
//     "id": 9,
//     "name": "异常类型"
//   },
//   {
//     "id": 10,
//     "name": "身份证证件类型"
//   },
//   {
//     "id": 12,
//     "name": "财会资格证书类型"
//   },
//   {
//     "id": 13,
//     "name": "教材类型"
//   },
//   {
//     "id": 14,
//     "name": "财务岗位"
//   }
// ]
// 获取数据字典
export const listDictionary = (data) => {
  return request({
    url: '/api/v1/pri/dictionary/listData',
    method: 'POST',
    data
  })
}
